const sequelize = require('../config/db.config');
const Sequelize = require('sequelize');

const User = sequelize.define('user', {
    // 编号
    id: {
      type: Sequelize.BIGINT,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field: 'id'
    },
    // 名字
    name: {
      type: Sequelize.STRING,
      allowNull: false,
      field: 'name'
    },
    // 0男 1女
    gender: {
      type: Sequelize.TINYINT,
      allowNull: true,
      defaultValue: 0,
      field: 'gender'
    },
    // 创建时间
    createTime: {
      type: Sequelize.DATE,
      allowNull: false,
      defaultValue: Sequelize.NOW,
      field: 'createTime'
    }
  }, {
    tableName: 'user',
    timestamps: false
  }
);
module.exports = User;